# -*- coding: utf-8 -*-
# @Author: Wen Xuejia
# @Date:   2018-06-04 15:01:25
# @Last Modified by:   Wen Xuejia
# @Last Modified time: 2018-06-11 13:28:25
from flask import Flask, g
from config import config
from ext import db
from register_blueprint_list import blueprint


def create_app(config_type):
    app = Flask(__name__)
    app.config.from_object(config[config[config_type]])
    db.init_app(app)
    for b in blueprint:
        app.register_blueprint(b)
    return app


app = create_app('config_type')
